/**
 * Generate code from /{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@NONE}}.java.hbs
 */
package cn.ibizlab.core.system.domain;

import java.util.*;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.*;
import org.springframework.data.annotation.*;
import cn.ibizlab.util.annotation.*;
import cn.ibizlab.util.enums.*;
import cn.ibizlab.util.domain.IEntity;
import cn.ibizlab.util.domain.EntityBase;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.Accessors;
import io.swagger.annotations.*;
import cn.ibizlab.core.system.domain.SysApiOperation;
import cn.ibizlab.core.system.domain.SysComponent;
import cn.ibizlab.core.system.domain.SysPermission;

/**
 * 组件使用接口实体类[SysComponentApi]
 *
 * @author generator
 */
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(value = "handler")
@ApiModel(value = "SYS_COMPONENT_API", description = "组件使用接口")
public class SysComponentApi extends EntityBase implements Serializable
{

    /**
     * 标识
     */
    @Id
    @DEField(name = "id" , isKeyField = true)
    @JsonProperty("id")
    @JSONField(name = "id")
    @ApiModelProperty(value = "id", notes = "标识")
    private String id;

    /**
     * 组件标识
     */
    @DEField(name = "component_id")
    @JsonProperty("component_id")
    @JSONField(name = "component_id")
    @ApiModelProperty(value = "component_id", notes = "组件标识")
    private String componentId;

    /**
     * 接口方法标识
     */
    @DEField(name = "api_operation_id")
    @JsonProperty("api_operation_id")
    @JSONField(name = "api_operation_id")
    @ApiModelProperty(value = "api_operation_id", notes = "接口方法标识")
    private String apiOperationId;

    /**
     * 显示名
     */
    @DEField(name = "display_name")
    @JsonProperty("display_name")
    @JSONField(name = "display_name")
    @ApiModelProperty(value = "display_name", notes = "显示名")
    private String displayName;

    /**
     * 接口方法
     */
    @JSONField(name = "api_operation")
    @JsonProperty("api_operation")
    @ApiModelProperty(value = "api_operation", notes = "接口方法")
    private SysApiOperation apiOperation;

    /**
     * 组件
     */
    @JSONField(name = "component")
    @JsonProperty("component")
    @ApiModelProperty(value = "component", notes = "组件")
    private SysComponent component;


    /**
     * 复制当前对象数据到目标对象(粘贴重置)
     * @param targetEntity 目标数据对象
     * @param includeEmpty  是否包括空值
     * @param <T>
     * @return
     */
    @Override
    public <T> T pasteTo(T targetEntity, boolean includeEmpty) {
        super.pasteTo(targetEntity, includeEmpty);
        if(targetEntity instanceof IEntity) {
            IEntity entity = ((IEntity) targetEntity);
            entity.reset("id");
        }
        return targetEntity;
    }

}